package Chapter05;
import java.util.Scanner;

public class Zuoye1 {
    public static void main(String[] args) {
        int i,j;
        Scanner input =new Scanner(System.in);
        int w=0;//宽
        int h =0;//高
        while(w<3||h<3){
            System.out.println("请输入矩形的宽和高");
            w=input.nextInt();
            h =input.nextInt();
        }
        for (i=0;i<h;i++){
            for (j=0;j<w;j++){
                if (i==0||i==h-1||j==0||j==w-1){
                    System.out.print("*");
                }else {
                    System.out.print(" ");
                }
            }
            System.out.println();
        }
    }
}
